import QtQuick 1.0
import com.nokia.symbian 1.0
import "../js/Storage.js" as Storage
import "../delegate"

PurePage {
    id: sessionOpenPage

    anchors { fill: parent; topMargin: statusBar.height; bottomMargin: toolBar.height }
    signal sessionType(int listIndex)

    ListModel {
        id: sessionOpenModel
    }

    LodingIndicator {
        id: lodingSessionOpenPage
    }

    ListView {
        id: sessionOpenListView

        anchors { fill: parent}
        cacheBuffer: 2 * height
        delegate: SessionOpenDelegate {}
        model: sessionOpenModel
    }

    ScrollBar {
        flickableItem: sessionOpenListView
        anchors { right: sessionOpenListView.right; top: sessionOpenListView.top }
    }

    onSessionType: {
        sessionOpenModel.clear();
        Storage.getSessionOpenCache(listIndex, sessionOpenModel);

    }

}
